<?php
function litimgurls($imgid=0)
{
    global $lit_imglist,$dsql;
    //获取附加表
    $row = $dsql->GetOne("SELECT c.addtable FROM #@__archives AS a LEFT JOIN #@__channeltype AS c 
                                                            ON a.channel=c.id where a.id='$imgid'");
    $addtable = trim($row['addtable']);
    
    //获取图片附加表imgurls字段内容进行处理
    $row = $dsql->GetOne("Select imgurls From `$addtable` where aid='$imgid'");
    
    //调用inc_channel_unit.php中ChannelUnit类
    $ChannelUnit = new ChannelUnit(2,$imgid);
    
    //调用ChannelUnit类中GetlitImgLinks方法处理缩略图
    $lit_imglist = $ChannelUnit->GetlitImgLinks($row['imgurls']);
    
    //返回结果
    return $lit_imglist;
}


//获得是否推荐的表述
function qin_isCommendArchives($iscommend){
	global $arcatts,$dsql;
	$arcatts = array();
	$dsql->Execute('n', 'SELECT * FROM `#@__arcatt` ');
	
	while($arr = $dsql->GetArray('n')) {
	    $arcatts[$arr['att']] = $arr['attname'];
	}
    $sn = '';
    foreach($arcatts as $k=>$v) {
        $v = cn_substr($v, 2);
        $sn .= (preg_match("#".$k."#", $iscommend) ? ' '.$v : '');
    }
    
    $sn = trim($sn);
    if($sn=='') return '';
    else return "[<font color='red'>$sn</font>]";
}

// 获得内容的标题  $id 文章id
/*function qin_getContentName($id){
	global $titleName,$dsql;
	$dsql->Execute('t',"SELECT t.title FROM dede_archives t WHERE t.id='$id'" );
	$titleName = $dsql->GetObject('t');
	if($t == '') {
		return '';
	}else {
		return $titleName;
	}
}*/